<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>全屏切换</title>
<script type="text/javascript">
//进入全屏
function enterFullScreen() {
var de = document.documentElement;
  if (de.requestFullscreen) {
    de.requestFullscreen();
  } else if (de.mozRequestFullScreen) {
    de.mozRequestFullScreen();
    } else if (de.webkitRequestFullScreen) {
     de.webkitRequestFullScreen();
               }
         }
      //退出全屏
       function exitFullScreen() {
            var de = document;
            if (de.exitFullscreen) {
                  de.exitFullscreen();
              } else if (de.mozCancelFullScreen) {
                  de.mozCancelFullScreen();
             } else if (de.webkitCancelFullScreen) {
                 de.webkitCancelFullScreen();
               }
         }
      </script>
     </head>
 <body>
     <div>
             <a href="javascript:;" onclick="enterFullScreen()">进入全屏</a>
             &nbsp;
             <a href="javascript:;" onclick="exitFullScreen()">退出全屏</a>
         </div>
 </body>
 </html>